package cn.jiyun.day4ceshi.service.impl;

import cn.jiyun.day4ceshi.dao.Udao;
import cn.jiyun.day4ceshi.pojo.Day3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Uservice implements cn.jiyun.day4ceshi.service.Uservice {
    @Resource
    private Udao udao;

    @Override
    public List<Day3> findAll() {
        return udao.selectList(null);
    }

    @Override
    public void del(Integer id) {
        udao.deleteById(id);
    }

    @Override
    public Day3 hx(Integer id) {
        return udao.selectById(id);
    }

    @Override
    public void add(Day3 day3) {
        day3.setId(0);
        udao.insert(day3);
    }

    @Override
    public void update(Day3 day3) {
        udao.updateById(day3);
    }
}
